<!-- 表格信息管理功能 -->
<template>
  <div id="table-function">
    <div class="content-scroll">
      <SmallTitle :titleName="titleName"></SmallTitle>
    </div>
  </div>
</template>

<script>
import SmallTitle from '../../parts/SmallTitle'
export default {
  name: 'table-function',
  components: {
    'SmallTitle': SmallTitle
  },
  data () {
    return {
      titleName: 'XXX表格'
    }
  },
  computed: {
  },
  methods: {
    addInfor () {
      if (this.inputName.length === 0) {
        this.$Message.error('姓名不可为空!')
      } else if (this.inputAge.length === 0) {
        this.$Message.error('年龄不可为空!')
      } else if (this.inputAddress.length === 0) {
        this.$Message.error('地址不可为空!')
      } else {
        this.datas.push({name: this.inputName, age: this.inputAge, address: this.inputAddress})
        this.$Message.success('添加成功!')
        this.inputName = ''
        this.inputAge = ''
        this.inputAddress = ''
      }
    },
    removeInfor (index) {
      this.datas.splice(index, 1)
    },
    searchInfor () {
    }
  }
}
</script>

<style scoped>
  /*@import '../../../../static/css/Parks.css';*/
  #table-function {
    height: 100%;
    width: auto;
  }

  .content-scroll {
    height: 100%;
    width: auto;
    overflow: scroll;
    overflow-x: auto;
  }
</style>
